<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="../../common/EditUIHead.jsp"></jsp:include>
<script type="text/javascript" src="${base}/default/js/module/basedata/person/personEdit.js"></script>
<title>职员</title>
</head>
<body style="padding:1px 3px 1px 3px;overflow:hidden">
	<div id="main">
		<div position="center">
			<form id="dataForm" class="l-form" action="${base }/basedata/person/save" method="post">
		  		<input type="hidden" id="dataId" name="id" value="${data.id}"/>
		  		<input type="hidden" id="positionJson" name="positionJson"/>
		  		<ul>
		  			<li class="field_label_li"><span style="color:red">*</span>员工编号：</li>
		  			<li style="width:182px;text-align:left;">
						<input name="number" id="number" validate="{required:true,maxlength:20}" type="text" value="${data.number}"/>
					</li>
					<li class="field_split_li"></li>
					<li class="field_label_li"><span style="color:red">*</span>姓名：</li>
		  			<li style="width:182px;text-align:left;">
						<input name="name" id="name" validate="{required:true,maxlength:20}" type="text" value="${data.name}"/>
					</li>
		  		</ul>
		  		<ul>
		  			<li class="field_label_li">曾用名：</li>
		  			<li style="width:182px;text-align:left;">
		  				<input name="oldName" id="oldName" validate="{maxlength:20}" type="text" value="${data.oldName}"/>
					</li>
					<li class="field_split_li"></li>
		  			<li class="field_label_li">简拼：</li>
		  			<li style="width:182px;text-align:left;">
						<input name="simplePinyin" id="simplePinyin" validate="{maxlength:40}" type="text" value="${data.simplePinyin}"/>
					</li>
		  		</ul>
		  		<ul>
		  			<li class="field_label_li"><span style="color:red">*</span>身份证号：</li>
		  			<li style="width:182px;text-align:left;">
		  				<input name="idCard" id="idCard" validate="{maxlength:20}" type="text" value="${data.idCard}"/>
					</li>
					<li class="field_split_li"></li>
		  			<li class="field_label_li"><span style="color:red">*</span>出生日期：</li>
		  			<li style="width:182px;text-align:left;">
						<input name="birthday" id="birthday" validate="{required:true}" type="text" value="<fmt:formatDate value="${data.birthday}" pattern="yyyy-MM-dd"/>" readOnly="readOnly" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
					</li>
		  		</ul>
		  		<ul>
		  			<li class="field_label_li"><span style="color:red">*</span>性别：</li>
		  			<li style="width:182px;text-align:left;">
		  				<label><input name="sex" type="radio" value="MAN" <c:if test="${data.sex!='WOMAN' }">checked="checked"</c:if>/>男</label>
		  				<label><input name="sex" type="radio" value="WOMAN" <c:if test="${data.sex=='WOMAN' }">checked="checked"</c:if>/>女</label>
					</li>
					<li class="field_split_li"></li>
		  			<li class="field_label_li"><span style="color:red">*</span>手机号码：</li>
		  			<li style="width:182px;text-align:left;">
						<input name="phone" id="phone" validate="{required:true}" type="text" value="${data.phone }" />
					</li>
		  		</ul>
		  		<ul>
		  			<li class="field_label_li">公司短号：</li>
		  			<li style="width:182px;text-align:left;">
		  				<input name="shortNumber" id="shortNumber" validate="{maxlength:20}" type="text" value="${data.shortNumber}"/>
					</li>
					<li class="field_split_li"></li>
		  			<li class="field_label_li">邮箱：</li>
		  			<li style="width:182px;text-align:left;">
						<input name="email" id="email" validate="{maxlength:40,email:true}" type="text" value="${data.email}"/>
					</li>
		  		</ul>
		  		<ul>
		  			<li class="field_label_li"><span style="color:red">*</span>紧急联系人：</li>
		  			<li style="width:182px;text-align:left;">
		  				<input name="crashContract" id="crashContract" validate="{required:true,maxlength:20}" type="text" value="${data.crashContract}"/>
					</li>
					<li class="field_split_li"></li>
		  			<li class="field_label_li"><span style="color:red">*</span>联系人电话：</li>
		  			<li style="width:182px;text-align:left;">
						<input name="contractPhone" id="contractPhone" validate="{required:true,maxlength:40}" type="text" value="${data.contractPhone}"/>
					</li>
		  		</ul>
		  		<ul>
		  			<li class="field_label_li">
		  				<a href="javascript:void(0);" onclick="addPersonPosition();">增加</a>
		  			</li>
		  		</ul>
		  		<c:forEach items="${personPositions }" var="pp" varStatus="status">
		  			<ul index="${status.index }">
		  				<li class="field_label_li">组织：</li>
			  			<li style="width:120px;text-align:left;">
			  				<input type="hidden" name="id" value="${pp.id }"/>
			  				<div class="f7" id="org_${status.index }" dataPickerUrl="${base}/basedata/org/orgDataPicker" width="750px" height="500px" onchange="changeOrg" title="组织">
		                		<input dataPicker="value"  name="org.id" value="${pp.position.org.id}" type="hidden" readOnly="readOnly" />
		                		<input dataPicker="name" ondblclick="openDataPicker('org_${status.index }')" value="${pp.position.org.name}" name="org.name" type="text"/>
			        			<strong onclick="clearDataPicker('org_${status.index }')"></strong>
			        			<span class="p_hov" onclick="openDataPicker('org_${status.index }')"></span>
			        		</div>
						</li>
			  			<li class="field_label_li">职位：</li>
			  			<li style="width:120px;text-align:left;">
							<select name="position" style="width:110px">
								<option value="${pp.position.id }" selected="selected">${pp.position.name }</option>
							</select>
						</li>
						<li class="field_label_li">职级：</li>
			  			<li style="width:120px;text-align:left;">
							<select name="jobLevel" style="width:110px">
								<option value="${pp.jobLevel.id }" selected="selected">${pp.jobLevel.name }</option>
							</select>
						</li>
			  			<li style="width:100px;text-align:left;">
							<label><input name="primary" type="checkbox" value="true" <c:if test="${pp.primary==true }">checked="checked"</c:if>/>主要职位</label>
						</li>
		  			</ul>
		  		</c:forEach>
			</form>
		</div>
	</div>
</body>
</html>